# Contributor: Jake Buchholz Göktürk <tomalok@gmail.com>
# Maintainer: Jake Buchholz Göktürk <tomalok@gmail.com>

pkgname=runc
pkgdesc="CLI tool for spawning and running containers according to the OCI specification"
url="https://www.opencontainers.org"
_commit=d7735e388ef5eecbd60d93bfbe5afe0f3fbc8a6b
pkgver=1.2.1
pkgrel=0
arch="all"
license="Apache-2.0"
makedepends="bash go go-md2man libseccomp-dev libtool"
subpackages="$pkgname-doc"
source="https://github.com/opencontainers/runc/archive/v$pkgver/runc-$pkgver.tar.gz
	add-seccomp-for-loongarch64.patch
	"
options="!check"

provides="oci-runtime"
provider_priority=90

# secfixes:
#   1.1.14-r0:
#     - CVE-2024-45310
#   1.1.12-r0:
#     - CVE-2024-21626
#   1.1.4-r0:
#     - CVE-2023-25809
#     - CVE-2023-27561
#     - CVE-2023-28642
#   1.1.4-r7:
#     - CVE-2023-27561
#   1.1.2-r0:
#     - CVE-2022-29162
#   1.0.3-r0:
#     - CVE-2021-43784
#   1.0.0_rc95-r0:
#     - CVE-2021-30465
#   1.0.0_rc10-r0:
#     - CVE-2019-19921
#   1.0.0_rc9-r0:
#     - CVE-2019-16884
#   1.0.0_rc7-r0:
#     - CVE-2019-5736

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	make COMMIT="$_commit"
	make man
}

package() {
	install -Dsm755 runc "$pkgdir"/usr/bin/runc
	install -Dm644 "$builddir"/man/man8/* -t "$pkgdir"/usr/share/man/man8/
}

sha512sums="
098ba9810d6a6704b11f97360cf403d0e5cccdf635a9b5c594b70e26c2c1554c328506265754f500e2faec1f08655839837036010c6a25265047a47c31f4defd  runc-1.2.1.tar.gz
fd30eb4555b56e6b66bc9ef77445db93cb6fa3e2122740188ab5fa36a5da045d190f26368b54f42a7fd0bf39bb7825a5cb054878540bcffc319f676d554ec01a  add-seccomp-for-loongarch64.patch
"
